package com.wutong.teacher_server.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * Create By Administrator on 2020/11/16.
 */
@RestController
@RequestMapping("/webSocket")
public class WebSocketController {

    @RequestMapping("/push")
    public void pushToWeb(@RequestParam("msg") String msg,@RequestParam("toUserId") String toUserId){
        try {
            WebSocketServer.sendInfo(msg,toUserId);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
